#region

using System;
using System.Configuration.Provider;

#endregion

namespace BuildMotion.MotionTracker.Provider
{
    public class MotionTrackerProviderCollection : ProviderCollection
    {
        public new MotionTrackerProvider this[string name]
        {
            get { return (MotionTrackerProvider) base[name]; }
        }

        /// <summary>
        /// Adds the specified provider.
        /// </summary>
        /// <param name="provider">The provider.</param>
        public void Add(MotionTrackerProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (!(provider is MotionTrackerProvider))
            {
                throw new ArgumentException("Invalid provider type", "provider");
            }
            base.Add(provider);
        }
    }
}